Introduction

subdiagnosis <- readr::read_tsv(
  file.path("..", "..", "..", "data", "current", params$scpca_project_id, "single_cell_metadata.tsv"),
  show_col_types = FALSE
  ) |>
  dplyr::filter(scpca_sample_id == params$sample_id) |>
  dplyr::pull(subdiagnosis)

This notebook explores using CopyKAT or infercnv to estimate tumor and normal cells in SCPCS000208 from SCPCP000006. This sample has a(n) Anaplastic subdiagnosis.

CopyKAT was run using the 05_copyKAT.R script with and without a normal reference, using 2 different methods to calculate the distance, namely euclidean or spearman.

infercnv was run using the 06_inferCNV.R script with and without a normal reference. We also tested the impact of the subselection of normal cells using either immune, and/or endothelial cells as healthy reference.

In this notebook, we just want to compare the heatmaps of CNV profiles, and evaluate how comparable are the methods and how snesible they are to key parameters such as choice of distance or choice of healthy reference.

Base directories

# The base path for the OpenScPCA repository, found by its (hidden) .git directory
repository_base <- rprojroot::find_root(rprojroot::is_git_root)

# The path to this module
module_base <- file.path(repository_base, "analyses", "cell-type-wilms-tumor-06")

Input files

The input for this notebook are the results of 05_copyKAT.R and 06_inferCNV.R

result_dir <- file.path(module_base, "results", params$sample_id)

CopyKAT results

Below we look at the heatmaps produced by CopyKAT.

Heatmaps without reference

distance = euclidean

distance = spearman

Heatmasp with endothelial cells as reference

distance = euclidean

distance = spearman

infercnv results

Heatmaps without reference

Heatmaps with immune cells as reference

Heatmaps with endothelium cells as reference

Heatmaps with immune and endothelium cells as reference

Conclusions

Session Info

# record the versions of the packages used in this analysis and other environment information
sessionInfo()
## R version 4.4.1 (2024-06-14)
## Platform: x86_64-pc-linux-gnu
## Running under: Ubuntu 22.04.4 LTS
## 
## Matrix products: default
## BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## time zone: Europe/Vienna
## tzcode source: system (glibc)
## 
## attached base packages:
## [1] stats4    stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
##  [1] infercnv_1.20.0        ggalluvial_0.12.5      org.Hs.eg.db_3.19.1    AnnotationDbi_1.66.0   IRanges_2.38.1         S4Vectors_0.42.1       Biobase_2.64.0        
##  [8] BiocGenerics_0.50.0    clusterProfiler_4.12.6 enrichplot_1.24.4      msigdbr_7.5.1          patchwork_1.2.0        lubridate_1.9.3        forcats_1.0.0         
## [15] stringr_1.5.1          dplyr_1.1.4            purrr_1.0.2            readr_2.1.5            tidyr_1.3.1            tibble_3.2.1           ggplot2_3.5.1         
## [22] tidyverse_2.0.0        SCpubr_2.0.2           sctransform_0.4.1      Seurat_5.1.0           SeuratObject_5.0.2     sp_2.1-4               optparse_1.7.5        
## [29] Matrix_1.7-0          
## 
## loaded via a namespace (and not attached):
##   [1] bitops_1.0-8                fs_1.6.4                    matrixStats_1.3.0           spatstat.sparse_3.1-0       httr_1.4.7                  RColorBrewer_1.1-3         
##   [7] doParallel_1.0.17           tools_4.4.1                 DT_0.33                     utf8_1.2.4                  R6_2.5.1                    lazyeval_0.2.2             
##  [13] uwot_0.2.2                  withr_3.0.1                 gridExtra_2.3               parallelDist_0.2.6          progressr_0.14.0            argparse_2.2.3             
##  [19] cli_3.6.3                   formatR_1.14                spatstat.explore_3.3-2      fastDummies_1.7.4           scatterpie_0.2.4            sandwich_3.1-1             
##  [25] sass_0.4.9                  mvtnorm_1.3-1               spatstat.data_3.1-2         ggridges_0.5.6              pbapply_1.7-2               yulab.utils_0.1.7          
##  [31] gson_0.1.0                  DOSE_3.30.5                 R.utils_2.12.3              parallelly_1.38.0           limma_3.60.4                rstudioapi_0.16.0          
##  [37] RSQLite_2.3.7               generics_0.1.3              gridGraphics_0.5-1          vroom_1.6.5                 gtools_3.9.5                ica_1.0-3                  
##  [43] spatstat.random_3.3-1       GO.db_3.19.1                futile.logger_1.4.3         fansi_1.0.6                 abind_1.4-5                 R.methodsS3_1.8.2          
##  [49] lifecycle_1.0.4             yaml_2.3.10                 edgeR_4.2.1                 multcomp_1.4-26             SummarizedExperiment_1.34.0 gplots_3.1.3.1             
##  [55] SparseArray_1.4.8           qvalue_2.36.0               Rtsne_0.17                  grid_4.4.1                  blob_1.2.4                  promises_1.3.0             
##  [61] crayon_1.5.3                miniUI_0.1.1.1              lattice_0.22-6              cowplot_1.1.3               KEGGREST_1.44.1             pillar_1.9.0               
##  [67] knitr_1.48                  GenomicRanges_1.56.1        fgsea_1.30.0                future.apply_1.11.2         codetools_0.2-20            fastmatch_1.1-4            
##  [73] leiden_0.4.3.1              glue_1.7.0                  ggfun_0.1.6                 spatstat.univar_3.0-0       data.table_1.16.0           vctrs_0.6.5                
##  [79] png_0.1-8                   treeio_1.28.0               spam_2.10-0                 gtable_0.3.5                cachem_1.1.0                xfun_0.47                  
##  [85] S4Arrays_1.4.1              mime_0.12                   libcoin_1.0-10              tidygraph_1.3.1             coda_0.19-4.1               survival_3.7-0             
##  [91] SingleCellExperiment_1.26.0 iterators_1.0.14            statmod_1.5.0               TH.data_1.1-2               fitdistrplus_1.2-1          ROCR_1.0-11                
##  [97] nlme_3.1-166                ggtree_3.12.0               bit64_4.0.5                 RcppAnnoy_0.0.22            rprojroot_2.0.4             GenomeInfoDb_1.40.1        
## [103] bslib_0.8.0                 irlba_2.3.5.1               KernSmooth_2.23-24          colorspace_2.1-1            DBI_1.2.3                   tidyselect_1.2.1           
## [109] bit_4.0.5                   compiler_4.4.1              httr2_1.0.3                 DelayedArray_0.30.1         plotly_4.10.4               shadowtext_0.1.4           
## [115] caTools_1.18.2              scales_1.3.0                lmtest_0.9-40               rappdirs_0.3.3              digest_0.6.37               goftest_1.2-3              
## [121] spatstat.utils_3.1-0        rmarkdown_2.28              XVector_0.44.0              htmltools_0.5.8.1           pkgconfig_2.0.3             MatrixGenerics_1.16.0      
## [127] fastmap_1.2.0               rlang_1.1.4                 htmlwidgets_1.6.4           UCSC.utils_1.0.0            shiny_1.9.1                 jquerylib_0.1.4            
## [133] farver_2.1.2                zoo_1.8-12                  jsonlite_1.8.8              BiocParallel_1.38.0         GOSemSim_2.30.2             R.oo_1.26.0                
## [139] magrittr_2.0.3              modeltools_0.2-23           GenomeInfoDbData_1.2.12     ggplotify_0.1.2             dotCall64_1.1-1             munsell_0.5.1              
## [145] Rcpp_1.0.13                 ape_5.8                     babelgene_22.9              viridis_0.6.5               reticulate_1.38.0           stringi_1.8.4              
## [151] ggraph_2.2.1                zlibbioc_1.50.0             MASS_7.3-61                 plyr_1.8.9                  parallel_4.4.1              listenv_0.9.1              
## [157] ggrepel_0.9.5               deldir_2.0-4                Biostrings_2.72.1           graphlayouts_1.1.1          splines_4.4.1               tensor_1.5                 
## [163] hms_1.1.3                   locfit_1.5-9.10             fastcluster_1.2.6           igraph_2.0.3                spatstat.geom_3.3-2         RcppHNSW_0.6.0             
## [169] reshape2_1.4.4              futile.options_1.0.1        evaluate_0.24.0             RcppParallel_5.1.9          lambda.r_1.2.4              phyclust_0.1-34            
## [175] tzdb_0.4.0                  foreach_1.5.2               tweenr_2.0.3                httpuv_1.6.15               RANN_2.6.2                  getopt_1.20.4              
## [181] polyclip_1.10-7             future_1.34.0               scattermore_1.2             ggforce_0.4.2               coin_1.4-3                  xtable_1.8-4               
## [187] RSpectra_0.16-2             tidytree_0.4.6              later_1.3.2                 rjags_4-16                  viridisLite_0.4.2           aplot_0.2.3                
## [193] memoise_2.0.1               cluster_2.1.6               timechange_0.3.0            globals_0.16.3